﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WebApi.Domain.entity;

namespace WebApi.Domain
{
    public class DbInitializeHelper
    {
        public static void Initialize()
        {
            using (var huihui = new WebApiDbContext())
            {
                huihui.Database.EnsureCreated();

                var Y = new Role
                {
                    RoleName = "wxh",
                    Description = "最胖的人"
                };

                huihui.Role.Add(Y);
                huihui.SaveChanges();

                var X = new User
                {
                    UserName = "死胖子",
                    PassWord = "123456",
                    RoleId = 1
                };

                huihui.User.Add(X);
                huihui.SaveChanges();
            }
        }
    }
}
